/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gov.police.diary.dao.impl;

import gov.police.diary.dao.CustomHibernateDaoSupport;
import gov.police.diary.dao.UnitDao;
import gov.police.diary.model.PolUnit;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author nmduc
 */
@Repository("UnitDao")
@Transactional
public class UnitDaoImpl extends CustomHibernateDaoSupport implements UnitDao {

    public PolUnit getUnit(long id) {
        return getHibernateTemplate().get(PolUnit.class, id);
    }

    public void saveUnit(PolUnit unit) {
        getHibernateTemplate().save(unit);
    }

    public void deleteUnit(PolUnit unit) {
        getHibernateTemplate().delete(unit);
    }

    public void updateUnit(PolUnit unit) {
        getHibernateTemplate().update(unit);
    }

}
